#include "MoveToThread.h"

MoveToThread::MoveToThread(QWidget *parent)
    : QWidget(parent)
{
    ui.setupUi(this);
	this->setWindowTitle("TCP服务端MoveToThread");
	this->setWindowIcon(QIcon(":/images/images/Qicon.jpg"));
	this->server = new MyTcpServer;
	this->server->listen(QHostAddress::AnyIPv4, 8000);
	QObject::connect(server, &MyTcpServer::signal_to_showMsg, this, &MoveToThread::showMsg);
}

MoveToThread::~MoveToThread()
{}

void MoveToThread::showMsg(QString strMsg, QString strIp, QString strPort)
{
	ui.mainLineEdit->setText(strMsg);
	ui.ipLineEdit->setText(strIp);
	ui.portLineEdit->setText(strPort);
}